﻿{% extends "gma/base.html" %}
{% load mytag %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title">
        <i class="fa fa-images weui_grid_icon_fa" style="font-size: 32px;"> </i> 主播资料审核
    </h1>
    <p class="page__desc">  </p>
</div>

<div class="page__bd">
    <div class="weui-cells__title">主播信息</div>
    <div class="weui-cells">
        <a class="weui-cell weui-cell_access" href="{% url 'gma:caster_detail' user.uid %}">
            <div class="weui-cell__bd"> <p>[{{ user.id }}] {{ user.auth_nickname }}</p> </div>
            <div class="weui-cell__ft"> <img src="{{ user.avatar|cdn }}" class="right_large_avatar"> </div>
        </a>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>昵称</p> </div>
            <div class="weui-cell__ft">{{ user.auth_nickname }}</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>城市</p> </div>
            <div class="weui-cell__ft">{{ user.auth_city }}</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>签名</p> </div>
            <div class="weui-cell__ft">{{ user.auth_signature }}</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>介绍</p> </div>
            <div class="weui-cell__ft">{{ user.introduction }}</div>
        </div>
    </div>

    <div class="weui-cells__title">修改资料</div>
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>昵称</p> </div>
            {% if user.auth_nickname != profile.nickname %}
                <div class="weui-cell__ft red_color">{{ profile.nickname }}</div>
            {% else %}
                <div class="weui-cell__ft">{{ profile.nickname }}</div>
            {% endif %}
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>城市</p> </div>
            {% if user.auth_city != profile.city %}
                <div class="weui-cell__ft red_color">{{ profile.city }}</div>
            {% else %}
                <div class="weui-cell__ft">{{ profile.city }}</div>
            {% endif %}
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>签名</p> </div>
            {% if user.auth_signature != profile.signature %}
                <div class="weui-cell__ft red_color">{{ profile.signature }}</div>
            {% else %}
                <div class="weui-cell__ft">{{ profile.signature }}</div>
            {% endif %}
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd"> <p>介绍</p> </div>
            {% if user.introduction != profile.introduction %}
                <div class="weui-cell__ft red_color">{{ profile.introduction }}</div>
            {% else %}
                <div class="weui-cell__ft">{{ profile.introduction }}</div>
            {% endif %}
        </div>
    </div>

    <br>
</div>

<div class="weui-btn-area">
    {% if profile.status == 1 %}
        <a class="weui-btn weui-btn_block weui-btn_primary" href="javascript:agree()">同意</a>
        <a class="weui-btn weui-btn_block weui-btn_warn" href="javascript:reject()">拒绝</a>
    {% endif %}
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}


<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}

<script>
function agree() {
    let url = "{% url 'gma:api_agree_profile' %}";
    let data = {
        'profile_id': {{ profile.id }},
    };

    new my_ajax(url, data, '', '', () => {
        show_toast("同意资料修改!");
        window.history.back();
    });
}

function reject() {
    let url = "{% url 'gma:api_reject_profile' %}";
    let data = {
        'profile_id': {{ profile.id }},
    };

    new my_ajax(url, data, '', '', () => {
        show_toast("不同意资料修改!");
        window.history.back();
    });
}
</script>
{% endblock extra_js %}